<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="react-root"></div>
	<script src="../build/react.js"></script>
	<script src="../build/react-dom.js"></script>
	<script src="../build/browser.min.js"></script>
    <script type="text/babel">
        // babel浏览器环境使用：http://www.ruanyifeng.com/blog/2016/01/babel.html
        /* eslint-disable no-undef, no-unused-vars */
		class Counter extends React.Component {
			constructor(props){
				super(props)
				this.state = { count : 0 }
				this.incrementCount = this.incrementCount.bind(this)
			}
			incrementCount(){
				this.setState((prevState, props) => ({
					count: prevState.count + 1
				}))
				this.setState((prevState, props) => ({
					count: prevState.count + 1
				}))
			}
			render(){
				return <div>
                    <button onClick={this.incrementCount}>Increment</button>
                    {this.state.count}
                </div>
			}
		}

		ReactDOM.render(
			<Counter />,
			document.getElementById('react-root')
		)
	</script>
</body>
</html>